package com.zyit.dao;

import com.zyit.entity.T_goods;
import com.zyit.util.BeanRowMapper;
import com.zyit.util.DBHelp;

import java.util.List;

public class UserOrderDao {
    private DBHelp dbHelp = new DBHelp();

    public List<T_goods>  findById(String id) {
        String sql = "SELECT t_goods.goods_name,t_goods.price,t_goods.file_name,t_goods.stock,t_base_order.order_no FROM t_goods INNER JOIN t_order_info ON t_goods.id = t_order_info.goods_id INNER JOIN t_base_order ON t_base_order.id = t_order_info.base_order_id WHERE account = ?";
        return dbHelp.executeQueryForList(sql,new BeanRowMapper<>(T_goods.class),id);
    }
}
